import { IsNotEmpty } from 'class-validator';
import { ApiProperty, PartialType } from '@nestjs/swagger';
import { Decorator_DtoIsNumber_Base } from '@/common/decorators/dtoIsNumber';
import { UserClient } from '@/modules/businessModule/userClient/assets/userClient.entity';
import { Good } from '@/modules/businessModule/good/assets/good.entity';
import { Order } from '@/modules/businessModule/order/assets/order.entity';

export class Seat_Create_Dto {
  @IsNotEmpty()
  @ApiProperty({ description: '物品ID', type: () => Good })
  good: Good;

  @IsNotEmpty()
  @ApiProperty({ description: '用户ID', type: () => UserClient })
  userClient: UserClient;

  @IsNotEmpty()
  @ApiProperty({ description: '订单ID', type: () => Order })
  order: Order;
}

export class Seat_Update_Dto extends PartialType(Seat_Create_Dto) {
  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  id: number;

  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  @ApiProperty({ type: 'bigint', description: '购买时间' })
  seatBuyTime: number;
}
